﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace HA.ModFlow.Domain.DomainLayer
{
    [Serializable]
   public class RechargePeriod:INotifyPropertyChanged, ICloneable
   {
       #region 构造函数

       public RechargePeriod(int rCount,int cCount)
        {
            this._flux=new double[rCount,cCount];
            this._indicator = new int[rCount, cCount];

            for (int i = 0; i < rCount; i++)
            {
                for (int j = 0; j < cCount; j++)
                {
                    _indicator[i, j] = 1;
                }
            }
        }

       #endregion

       public RechargePeriod()
       {
       }
       double[,] _flux;


        /// <summary>
        /// 补给量数组
        /// </summary>
        public double[,] Flux
        {
            get { return _flux; }
            set {
                  _flux = value;
                }
        }

        int[,] _indicator;

        
        public int[,] Indicator
        {
            get { return _indicator; }
            set { 
                  _indicator = value;;
                }
        }

        double _multiplier = 1.0;

        public double Multiplier
        {
            get { return _multiplier; }
            set 
            {
                _multiplier = value;
                OnPropertyChanged("Multiplier");
            }
        }

        #region INotifyPropertyChanged

        [field:NonSerialized]
        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

        #region ICloneable

        public object Clone()
        {
            RechargePeriod obj = new RechargePeriod();
            obj =(RechargePeriod)this.MemberwiseClone();
            obj.Flux =(double [,]) this.Flux.Clone();
            obj.Indicator =(int [,]) this.Indicator.Clone();
            
            return obj;
        }

        #endregion
   }
}
